package 代码coding题OR模拟题;

import java.util.Arrays;

public class leetcode944删除造序 {
	public static void main(String []args) {
		String []strs = {"abc", "bce", "cae"};
//		String strs []= {"zyx","wvu","tsr"};
		System.out.println(solution(strs));
	}
	static int solution(String str[]) {
		int row = str.length;
		int col = str[0].length();
		char [][] s = new char [row][col];
		for(int i = 0;i < row;i++)
			s[i] = str[i].toCharArray();
		for(char ch[] : s)
			System.out.println(Arrays.toString(ch));
		int ans = 0;
		for(int i = 0;i < col;i++) {
//			boolean flag = true;
			for(int  j = 0;j < row - 1;j++) {
				if(s[j][i] > s[j + 1][i]) {
//					flag = false;
					ans++;
					break;
				}
			}
//			if(flag)
//			ans++;
		}
		return ans;
	}
}
